<template>
  <div style="height: 100%;">
    <message-list :messages="messageList"/>
  </div>
</template>

<script>
import messageList from '@/components/messageList'
import api from '@/api'
export default {
  name: 'message',
  data () {
    return {
      messageList: []
    }
  },
  methods: {},
  components: {
    messageList
  },
  created () {
    api.getMessage({
      params: {
        id: JSON.parse(sessionStorage.getItem('user')).id,
        type: this.$route.params.type
      },
      callback: res => {
        this.messageList = res.data.data
        // console.log(res)
      }
    })
  }
}
</script>

<style scoped>

</style>
